package com.wechat.admin.controller;

import com.wechat.admin.common.BaseResponse;
import com.wechat.admin.common.ResultUtils;
import com.wechat.admin.service.UserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author:sjb
 * @CreateTime:2024-12-13
 * @Description: 健康检查接口
 * @Version：1.0
 */
@RequestMapping("/test")
@RestController
@Slf4j
public class MainController {

    @Resource
    private UserService userService;

    @PostMapping("/health")
    public BaseResponse<String> testHealthCondition(){
        log.info("通过健康检查");
        return ResultUtils.success("你好");
    }

    @GetMapping("/testUpdate")
    public BaseResponse<Long> testUpdateTable(){
        long l = userService.updateTables();
        return ResultUtils.success(l);
    }
}
